<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta content="telephone=no" name="format-detection" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
	<meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="/Content/css/bootstrap.min.css" rel="stylesheet">
    <link href="/Content/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="/Content/css/animate.css" rel="stylesheet">
    <link href="/Content/css/style.css" rel="stylesheet">
	
    <script src="/Content/js/jquery-2.1.1.js"></script>
	<script src="/Content/layer/layer.js"></script>	
	

</head>
<body> 
    <div class="middle-box text-center loginscreen animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name"></h1>

            </div>
            <h3>登录</h3>
          
            <p></p>
            <form class="m-t" role="form" action="index.html">
                <div class="form-group">
                    <input type="text" class="form-control" id="username" placeholder="用户名" required="">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" id="password" placeholder="密码" required="">
                </div>
				<p id="ruc_error_common_msg" style="color:red;"></p>
                <button type="button" class="btn btn-primary block full-width m-b login">登录</button>
	
              <br/><br/>
              
                <a class="btn btn-sm btn-white btn-block" href="reg.html">没有账号</a><br/>
				 
            </form>
           
        </div>
    </div>



	<script>
	
	$(function(){
		$(".login").click(function(){
				var username =$("#username").val();
				var password =$("#password").val();
				if(username==""){
					layer.msg('请输入用户名');
				}else if(password==""){
					layer.msg('请输入密码');
				}else{
					
					$.post("{:U('Home/Index/login')}",{"username":username,"password":password},function(data){
					console.log(data);
					if(data.status=="0"){
						$("#ruc_error_common_msg").html("用户名密码错误");
					
					}else{
						location.href="{:U('Home/Index/login')}";
					}
					});
				}
		});
	
	});
		
	
	</script>
</body>
</html>

